{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/gxd/code/fly-craft-examples\n"
     ]
    }
   ],
   "source": [
    "import gymnasium as gym\n",
    "import flycraft\n",
    "import sys\n",
    "from pathlib import Path\n",
    "import numpy as np\n",
    "\n",
    "PROJECT_ROOT_DIR = Path().absolute().parent.parent.parent\n",
    "print(PROJECT_ROOT_DIR)\n",
    "if str(PROJECT_ROOT_DIR.absolute()) not in sys.path:\n",
    "    sys.path.append(str(PROJECT_ROOT_DIR.absolute()))\n",
    "\n",
    "from utils_my.sb3.my_wrappers import ScaledObservationWrapper"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "load config from: /home/gxd/anaconda3/envs/disc/lib/python3.12/site-packages/flycraft/configs/NMR.json\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<OrderEnforcing<PassiveEnvChecker<FlyCraftEnv<FlyCraft-v0>>>>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "env = gym.make(\"FlyCraft-v0\")\n",
    "env"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<ScaledObservationWrapper<OrderEnforcing<PassiveEnvChecker<FlyCraftEnv<FlyCraft-v0>>>>>,\n",
       " True)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scaled_env = ScaledObservationWrapper(env)\n",
    "scaled_env"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "isinstance(env.unwrapped, gym.Wrapper)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array('[10.0, 3.0, 3.0]', dtype='<U16')"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = np.array(\"[10.0, 3.0, 3.0]\")\n",
    "a"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "disc",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
